All Packages Class Hierarchy This Package Previous Next Index
java.lang.Object | +----sjl.Not1
Not1
class can wrap a
Predicate1
class so that the truth value is reversed.
public class IsGreen implements Predicate1 { public boolean compare(Object car) { return ((Car)car).color = "Green"; } } Algo.find(list.begin(), list.end(), new Not1(new IsGreen()));The above example will return a iterator to the first car that is not green.
Copyright © 1996 Finn Bock
public Not1(Predicate1 pred)
public boolean compare(Object o)
All Packages Class Hierarchy This Package Previous Next Index